package com.burningtower.controller;


import com.baomidou.mybatisplus.plugins.Page;
import com.burningtower.entity.TbTypeSource;
import com.burningtower.service.ITbTypeSourceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 来源类型 前端控制器
 * </p>
 *
 * @author zhe
 * @since 2017-11-17
 */
@RestController
@RequestMapping("/tbTypeSource")
public class TbTypeSourceController {
    @Autowired
    private ITbTypeSourceService service;
    @RequestMapping("dataAll")
    public List<TbTypeSource> dataAll(Integer page, Integer rows, String sort, String order){
        Page<TbTypeSource> page1=new Page(page,rows,sort);
        page1.setAsc("asc".equals(order));
        Page<TbTypeSource> tbTypeSourcePage = service.selectPage(page1);
        return tbTypeSourcePage.getRecords();
    }
}

